<?php
require_once 'functions.php';
init_user();
function match_current_item($str1,$str2){
	if($str1==$str2){
		echo "current_page";
	}
}
?>
<div id="left_cpanel">
<?php if($userid!=-1){?>
<img src='<?php echo get_portrait_url($_SESSION["user"]["portrait"],"thumb");?>'><br>
<?php echo get_user_name_by_id($userid);?>
<span style='margin-left:10px;'></span><img style="vertical-align: middle;" src='image/<?php echo $_SESSION["user"]["sex"];?>.png'></span>
<?php }?>
<ul style='margin-top:30px;'>
<li class='left_cp_menu_item <?php match_current_item("loop", $current_page);?>'><a href="loop.php">物品列表</a></li>
<?php if($userid!=-1){?>
<li class='left_cp_menu_item <?php match_current_item("mine", $current_page);?>'><a href="loop.php?type=mine">我的发布</a></li>
<li class='left_cp_menu_item <?php match_current_item("publish", $current_page);?>'><a href="publish.php">发布新物品</a></li>
<?php }?>
</ul>
</div>